<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var arr=[];
			
			for(var i=48;i<=57;i++){
				arr.push(String.fromCharCode(i));
			}
			for(var i=65;i<=90;i++){
				arr.push(String.fromCharCode(i));
			}
			for(var i=97;i<=122;i++){
				arr.push(String.fromCharCode(i));
			}
			
			for(var j=0,str="";j<4;j++){
				var r=parseInt(Math.random()*(arr.length));
				str+=arr[r];
			}
			
			var user=prompt("请输入验证码："+str);
			if(str.toUpperCase()==user.toUpperCase()){
				document.write("<h1 style='color: green;'>验证通过</h1>");
			}else{
				document.write("<h1 style='color: red;'>验证失败</h1>");		
			}
		</script>
	</body>
</html>
